﻿using System;
using System.Drawing;
using System.Timers;

using DC2010.Objects;
using DC2010.Objects.Base;
using DC2010.Objects.Data;
using System.Collections.Generic;
using DC2010.Objects.Common;

namespace DC2010.Effects
{
    public class I_NestedEffect_Effect : EffectLogic
    {
		public List<EffectLogic> effs = new List<EffectLogic>();
		
        public I_NestedEffect_Effect(EffectData ed):base(ed)
        {
            ShortName = "Joined effects";
            LongName = "This effect joins other effects in sequence. Parameters are passed on and on...";
            Id = "I_NESTED_EFFECT";
            EffectType = EffectType.Instant;
        }

        public override void Instant(BaseObject aInvoker, BaseObject aTarget)
        {
			foreach(KeyValue kv in Data.Params)
			{
				string effectInfoCode = kv.Value;
				EffectInfo ei = Root.I.EffectSystem.GetInfo(effectInfoCode);
				EffectData ed = ei.CreateData();  //params? copied?
				
				ed.L.Instant(aInvoker, aTarget);
			}

            base.Instant(aInvoker, aTarget);
        }
    }
}
